<template>
  <el-container class="home-container">
    <!-- 头部区域 -->
    <el-header>
      <div>
        <img src="../assets/logo.png" alt="" />
        <span>电商后台管理系统</span>
      </div>
      <el-button type="info" @click="logout">退出</el-button>
    </el-header>
    <!-- 页面主体 -->
    <el-container>
      <!-- 侧边栏 -->

      <Aside />
      <!-- </el-aside> -->
      <!-- 右侧内容主体 -->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Aside from "./Aside.vue";


export default {
  data() {
    return {
    }
  },
  components: {
    Aside,
  },
  created() {
  },
  methods: {
    logout() {
      // 清空token
      window.sessionStorage.clear();
      // 跳转主页
      this.$router.push("/login");
    },
  }
}

</script>

<style lang="less" scoped>
.home-container {
  height: 100%;
}

.el-header {
  background-color: #373d41;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 20px;
  div {
    display: flex;
    align-items: center;
    height: 50px;
    img {
      height: 100%;
      background-color: #fff;
      border-radius: 5px;
    }
    span {
      margin-left: 15px;
    }
  }
}

.el-main {
  background-color: #eaedf1;
}
</style>